<?php
/**
 * Created by PhpStorm.
 * Author: Shadow
 * Date: 2022/6/18
 * Time: 9:03 上午
 * description: admin.php
 * admin 应用下面的路由
 *
 * Driver [Think] not supported 视图未安装
 *
 *  [InvalidArgumentException]
    Command "build" is not defined. 多应用扩展未安装
 *
 * mkdir(): Permission denied 权限不足
 * 404 路由问题、路径问题 没有找到
 */

use think\facade\Route;

// 首页
//Route::get('index',"index/index");
// 登录
Route::get('login','login/login');
Route::post('doLogin','login/doLogin')->token();
Route::get('logout','login/logout');// 退出登录

//路由分组

// 商品列表
Route::get('goodsList',"goods/list")->middleware(\app\admin\middleware\Login::class);// 商品列表
Route::post('goodsDel',"goods/del")->middleware(\app\admin\middleware\Login::class);;// 商品删除
Route::get('goodsAdd',"goods/goodsAdd")->middleware(\app\admin\middleware\Login::class)->token();// 商品添加页面展示

// 在路由里面验证token
//Route::post('goodsSave',"goods/goodsSave")->middleware(\app\admin\middleware\Login::class)->token();// 商品添加入库


Route::post('goodsSave',"goods/goodsSave")->middleware(\app\admin\middleware\Login::class);// 商品添加入库

// 商品修改
Route::get('editor',"goods/editor")->middleware(\app\admin\middleware\Login::class);;

Route::post('update','goods/update')->middleware(\app\admin\middleware\Login::class);;

// 状态的即点即改
Route::post('statusUpdate','goods/statusUpdate');

/**
 * 获取分类
 */
Route::get('getCategory','goods/getCategory');


// 公共函数
Route::get('common',"Goods/commonFunction")->middleware(\app\admin\middleware\Login::class);;

// 回话控制
Route::get("cookie","Login/cookieAndSession")->middleware(\app\admin\middleware\Login::class);;


/**
 * 管理员有关数据
 */
Route::get('managerList',"Manager/list");

/**
 * 富文本编辑器
 */
Route::get('wang',"Goods/wangEditor");
Route::post('wangAdd',"Goods/wangAdd");
Route::post('upload',"Goods/upload");



/**
 * 水印
 */
Route::get('water',"goods/water");




/**
 * DB方式操作数据库实现增删改查
 *
 */

Route::get('dbOperate','Auth/dbOperate');


/**
 * TP框架路由模式
 * 默认混合模式 支持pathinfo模式也支持路由规则
 *
 */
Route::get('index/[:name]','Rou/index')->append(['username' => 'guoshuaichao']);


/**
 * 动态的路由
 */

Route::get('run/:action','Rou/:action');

/**
 * 路由可以直接访问类中的方法
 */


// 可以指定路由访问的后缀 默认是html后缀 可以省略

Route::get('email',"\app\admin\service\Email@sendEmail")->ext('email');


/**
 * 资源路由
 */

Route::resource('res','res')->domain('www.2004a.com');


